package com.ruoyi.mes.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mes.mapper.WkspMaterialListDetailMapper;
import com.ruoyi.mes.domain.WkspMaterialListDetail;
import com.ruoyi.mes.service.IWkspMaterialListDetailService;

/**
 * 领料清单明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-13
 */
@Service
public class WkspMaterialListDetailServiceImpl implements IWkspMaterialListDetailService 
{
    @Autowired
    private WkspMaterialListDetailMapper wkspMaterialListDetailMapper;

    /**
     * 查询领料清单明细
     * 
     * @param id 领料清单明细主键
     * @return 领料清单明细
     */
    @Override
    public WkspMaterialListDetail selectWkspMaterialListDetailById(Long id)
    {
        return wkspMaterialListDetailMapper.selectWkspMaterialListDetailById(id);
    }

    /**
     * 查询领料清单明细列表
     * 
     * @param wkspMaterialListDetail 领料清单明细
     * @return 领料清单明细
     */
    @Override
    public List<WkspMaterialListDetail> selectWkspMaterialListDetailList(WkspMaterialListDetail wkspMaterialListDetail)
    {
        return wkspMaterialListDetailMapper.selectWkspMaterialListDetailList(wkspMaterialListDetail);
    }

    /**
     * 新增领料清单明细
     * 
     * @param wkspMaterialListDetail 领料清单明细
     * @return 结果
     */
    @Override
    public int insertWkspMaterialListDetail(WkspMaterialListDetail wkspMaterialListDetail)
    {
        return wkspMaterialListDetailMapper.insertWkspMaterialListDetail(wkspMaterialListDetail);
    }

    /**
     * 物料出库查询物料相关的接口
     *
     * @param mldId 物料清单id
     * @return 结果
     */
    public List<WkspMaterialListDetail> selectFromMaterialOut(Long mldId)
    {
        return wkspMaterialListDetailMapper.selectPickingListByMldId(mldId);
    }

    /**
     * 修改领料清单明细
     * 
     * @param wkspMaterialListDetail 领料清单明细
     * @return 结果
     */
    @Override
    public int updateWkspMaterialListDetail(WkspMaterialListDetail wkspMaterialListDetail)
    {
        return wkspMaterialListDetailMapper.updateWkspMaterialListDetail(wkspMaterialListDetail);
    }

    /**
     * 批量删除领料清单明细
     * 
     * @param ids 需要删除的领料清单明细主键
     * @return 结果
     */
    @Override
    public int deleteWkspMaterialListDetailByIds(Long[] ids)
    {
        return wkspMaterialListDetailMapper.deleteWkspMaterialListDetailByIds(ids);
    }

    /**
     * 删除领料清单明细信息
     * 
     * @param id 领料清单明细主键
     * @return 结果
     */
    @Override
    public int deleteWkspMaterialListDetailById(Long id)
    {
        return wkspMaterialListDetailMapper.deleteWkspMaterialListDetailById(id);
    }
}
